﻿//Class Definition
function ClassA() {
}

var ClassB = function () {
}


//Constructor
function ClassC(param1, param2) {

    //Construction code goes here; this will get called when creating a new instance of this class

}


//Namespace/Singleton
var MyNamespace = {
    ClassA: ClassA,
    ClassB: ClassB,
    ClassD: function () { }
}

var MyOtherNamespace = new function () {
    this.ClassA = ClassA;
    this.ClassE = function () { };
}

//Instanciating
var classAInstance = new ClassA();

//Encapsulation
function ClassX() {

    function privateMethod() { };

    var privateField = null,
        privateMethodAlternative = function () { };

    this.PublicField = "";
    this.PublicMethod = function () { };
}